<!DOCTYPE html>


<html lang="zh-CN">
  

    <head>
      <meta charset="utf-8" />
        
      <meta name="description" content="教学内容笔记，hexo搭建" />
      
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title> 韩东海教学博客</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/favicon.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css"
      />
      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
       
 

      <!-- mermaid -->
      
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      <canvas class="fireworks"></canvas>
      <style>
        .fireworks {
          position: fixed;
          left: 0;
          top: 0;
          z-index: 99999;
          pointer-events: none;
        }
      </style>
      
      
    <main class="content on">
      
<section class="cover">
    
      
      <a class="forkMe" href="https://github.com/Shen-Yu/hexo-theme-ayer"
        target="_blank"><img width="149" height="149" src="/images/forkme.png"
          class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/cover1.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">韩东海教学博客</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>


<!-- Subtitle -->

  <script>
    try {
      var typed = new Typed("#subtitle", {
        strings: ['好好学习，天天向上！', '愿你一生努力，一生被爱', '想要的都拥有，得不到的都释怀'],
        startDelay: 0,
        typeSpeed: 200,
        loop: true,
        backSpeed: 100,
        showCursor: true
      });
    } catch (err) {
      console.log(err)
    }
  </script>
  
<div id="main">
  <section class="outer">
  
  <ul class="ads">
    
        <li>
            <a target="_blank" rel="noopener" href="https://curl.qcloud.com/ezctH6FU">
                <img src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_1.jpg" width="300" alt="腾讯云限时秒杀">
            </a>
        </li>
    
        <li>
            <a target="_blank" rel="noopener" href="https://curl.qcloud.com/kvO7hb43">
                <img src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/ten_2.jpg" width="300" alt="云服务器全球购低至2折">
            </a>
        </li>
    
</ul>
  
  
  

<div class="notice" style="margin-top:50px">
    <i class="ri-heart-fill"></i>
    <div class="notice-content" id="broad"></div>
</div>
<script type="text/javascript">
    fetch('https://v1.hitokoto.cn')
        .then(response => response.json())
        .then(data => {
            document.getElementById("broad").innerHTML = data.hitokoto;
        })
        .catch(console.error)
</script>

<style>
    .notice {
        padding: 20px;
        border: 1px dashed #e6e6e6;
        color: #969696;
        position: relative;
        display: inline-block;
        width: 100%;
        background: #fbfbfb50;
        border-radius: 10px;
    }

    .notice i {
        float: left;
        color: #999;
        font-size: 16px;
        padding-right: 10px;
        vertical-align: middle;
        margin-top: -2px;
    }

    .notice-content {
        display: initial;
        vertical-align: middle;
    }
</style>
  
  <article class="articles">
    
    
    
    
    <article
  id="post-hexo博客格式示例"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/helloword.html"
    >hexo博客格式示例</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/helloword.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h3 id="学习目标："><a href="#学习目标：" class="headerlink" title="学习目标："></a>学习目标：</h3><p>1、了解python编程语言</p>
<p>2、了解变量的命名规则</p>
<p>3、掌握常见的运算符</p>
<p>4、了解五中数据类型</p>
<p>5、掌握函数的调用</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo/" rel="tag">hexo</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-blog技巧/Hexo 的思维导图插件"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/hexo_mindmap.html"
    >Hexo 的思维导图插件</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/hexo_mindmap.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>参考：<a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/75467441">https://zhuanlan.zhihu.com/p/75467441</a></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo/" rel="tag">hexo</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-blog技巧/python使用Pelican搭建极简静态博客系统"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/0.html"
    >python使用Pelican搭建极简静态博客系统</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/0.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/blog/">blog</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h3 id="一、安装-pelican"><a href="#一、安装-pelican" class="headerlink" title="一、安装 pelican"></a>一、安装 pelican</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install pelican markdown --upgrade</span><br></pre></td></tr></table></figure>


<h3 id="二、生成pelican骨架"><a href="#二、生成pelican骨架" class="headerlink" title="二、生成pelican骨架"></a>二、生成pelican骨架</h3><p> <code>pelican-quickstart # 生成pelican骨架</code> </p>
<p>安装过程过，会有很多需要你输入的配置项，如果不知道怎么填就直接忽略或者选择n，因为这些配置项在后面可以自己手动再添加的。</p>
<h3 id="三、目录结构"><a href="#三、目录结构" class="headerlink" title="三、目录结构"></a>三、目录结构</h3><p>创建完成后生成的目录结构如下：</p>
<p>.</p>
<p>├── Makefile</p>
<p>├── content/</p>
<p>├── develop_server.sh</p>
<p>├── fabfile.py</p>
<p>├── output/</p>
<p>├── pelicanconf.py</p>
<p>└── publishconf.py</p>
<p> 你的文章需要保存在content目录下 </p>
<h3 id="四、生成静态文件"><a href="#四、生成静态文件" class="headerlink" title="四、生成静态文件"></a>四、生成静态文件</h3><p>可以将你们的笔记拷入到content目录，最终需要经过 Pelican 的处理生成一个html格式的静态文件对外提供访问。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pelican content</span><br></pre></td></tr></table></figure>



<h3 id="五、启动服务"><a href="#五、启动服务" class="headerlink" title="五、启动服务"></a>五、启动服务</h3><p>Pelican 自己内置了一个HTTP Server，所以即使不需要Nginx也可以将程序运行起来。</p>
<p>pelican –listen ```</p>
<p>启动 http 服务，默认端口是8000，访问：<a target="_blank" rel="noopener" href="http://localhost:8000/">http://localhost:8000/</a></p>
<h3 id="六、主题管理"><a href="#六、主题管理" class="headerlink" title="六、主题管理"></a>六、主题管理</h3><h4 id="1、-pelican-themes-命令"><a href="#1、-pelican-themes-命令" class="headerlink" title="1、 pelican-themes 命令"></a>1、 pelican-themes 命令</h4><p>pelican-themes是管理主题的命令工具 </p>
<h5 id="一些基本用法："><a href="#一些基本用法：" class="headerlink" title="一些基本用法："></a>一些基本用法：</h5><table>
<thead>
<tr>
<th>pelican-themes -h</th>
<th>显示帮助</th>
</tr>
</thead>
<tbody><tr>
<td>pelican-themes -l</td>
<td>显示已经安装的主题</td>
</tr>
<tr>
<td>pelican-themes -i [theme_path]</td>
<td>安装主题</td>
</tr>
<tr>
<td>pelican-themes -r [theme_name]</td>
<td>删除主题</td>
</tr>
</tbody></table>
<h4 id="2、安装主题"><a href="#2、安装主题" class="headerlink" title="2、安装主题"></a>2、安装主题</h4><p>到<a target="_blank" rel="noopener" href="https://github.com/getpelican/pelican-themes%E5%8F%AF%E4%BB%A5%E4%B8%8B%E8%BD%BD%E5%BE%88%E5%A4%9A%E4%B8%BB%E9%A2%98">https://github.com/getpelican/pelican-themes可以下载很多主题</a></p>
<p>我这里选用Octopress Theme for Pelican 下载zip，然后解压，安装：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pelican-themes -i &#x2F;e&#x2F;pelican&#x2F;pelican-octopress-theme&#x2F;</span><br></pre></td></tr></table></figure>

<h4 id="3、应用主题"><a href="#3、应用主题" class="headerlink" title="3、应用主题"></a>3、应用主题</h4><p>到你所在站点的目录，有一个pelicanconf.py文件，添加或者修改THEME</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">THEME &#x3D; &quot;pelican-octopress-theme&quot;</span><br></pre></td></tr></table></figure>

<h4 id="4、重新生成html"><a href="#4、重新生成html" class="headerlink" title="4、重新生成html"></a>4、重新生成html</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pelican content</span><br></pre></td></tr></table></figure>

<h4 id="七、创造主题"><a href="#七、创造主题" class="headerlink" title="七、创造主题"></a>七、创造主题</h4><p>参考:<a target="_blank" rel="noopener" href="https://www.osgeo.cn/pelican/themes.html">https://www.osgeo.cn/pelican/themes.html</a></p>
<h4 id="八、插件"><a href="#八、插件" class="headerlink" title="八、插件"></a>八、插件</h4> 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/blog/" rel="tag">blog</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-python教学/1、第一课  认识python语言"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/a2e4d425.html"
    >第一课 认识python语言</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/a2e4d425.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h3 id="学习目标："><a href="#学习目标：" class="headerlink" title="学习目标："></a>学习目标：</h3><p>1、了解python编程语言</p>
<p>2、了解变量的命名规则</p>
<p>3、掌握常见的运算符</p>
<p>4、了解五中数据类型</p>
<p>5、掌握函数的调用</p>
<p>-—————————————</p>
<p>这里插入了两张图片</p>
<p><img src="https://runtool.gitee.io/images/coding.jpg"></p>
<p><img src="https://i0.hdslb.com/bfs/article/97072eedf795a25dc8abe2cf8a7ebfa5c90ebd29.png@1320w_1534h.webp"></p>
<h4 id="python-（蟒蛇）"><a href="#python-（蟒蛇）" class="headerlink" title="python  （蟒蛇）"></a>python  （蟒蛇）</h4><p>数据分析   人工智能   物联网</p>
<p>1、安装python解析器，才能运行</p>
<p>2、开始-》运行-》cmd -》python</p>
<p>3、使用的python3</p>
<h3 id="基本语法："><a href="#基本语法：" class="headerlink" title="基本语法："></a>基本语法：</h3><p>1、变量  命名以字母或者下划线开头    a=1    先定义后使用</p>
<p>2、变量可以参与运算，变量可以发生变化  a=a+1  </p>
<p>3、运算符   +(加) -（减）  *（乘）  /（浮点除，小数 是撇不是捺）   //（整除）    **（幂次方）    %（求余数）</p>
<p>4、时刻关注变量的值是否发生了变化</p>
<h4 id="数据类型"><a href="#数据类型" class="headerlink" title="数据类型"></a>数据类型</h4><p>​    1、数值类型     2（整）  3.14（浮点）  通过运算符运算</p>
<p>​    2、字符串(英文引号)     “hello”    +（连接）   索引</p>
<p>​    3、布尔      True  False    and  or  not </p>
<p>​    4、列表  （很多放到一起）  books=[“english”,”chinese”,”math”]  可以为空[] ，后期元素可以增删改</p>
<p>​    5、空  None</p>
<h4 id="函数：-ff-v"><a href="#函数：-ff-v" class="headerlink" title="函数：   ff(v)"></a>函数：   ff(v)</h4><p>把重复的一段代码，用简单的名称表示    f(v)     1、函数名称   2、参数(个数和类型)  3、返回值</p>
<p>​        火腿=做肉肠(生猪）</p>
<p>print    len （length）   min  max</p>
<p>sentemail(emailid,qqmessage)</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-python教学/2、第二课 程序的三种结构及if分支语句"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/b3907e08.html"
    >第二课 程序的三种结构及if分支语句</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/b3907e08.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>学习目标：</p>
<p>1、认识海龟编辑器</p>
<p>2、了解程序的三种运行结构</p>
<p>3、掌握if单分支，if-else双分支</p>
<p>4、强化函数的调用</p>
<p>-—————————————</p>
<p>1、海龟编辑器</p>
<p>​    1、怎么打开</p>
<p>​    2、转代码模式</p>
<p>2、缩进</p>
<p>​        1、输入空格    hello(不推荐)</p>
<p>​        2、制表符    hello  </p>
<p>3、程序结构（三种）</p>
<p>​    1、顺序</p>
<p>​    2、分支</p>
<p>​    3、循环</p>
<p>4、分支结构</p>
<p>​    1、if单分支</p>
<p>​        if 条件:</p>
<p>​            执行语句</p>
<p>​    2、if-else双分支</p>
<p>​        if 条件:</p>
<p>​            执行语句一</p>
<p>​        else:</p>
<p>​            执行语句二</p>
<p>print()    输出   a=ff(v1,v2)</p>
<p>input() 输入  ，返回是字符串</p>
<p>数据类型转换函数：  int()  （把字符串转为整型integer）</p>
<p>5、字符串  “abc”   特殊字符，不参与显示，转义字符    “\n”换行符   “\t”制表符</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-python教学/3、第三课  认识列表及for循环"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/7b1343c4.html"
    >第三课 认识列表及for迭代循环</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/7b1343c4.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>学习目标：</p>
<p>1、掌握列表的初始化</p>
<p>2、掌握列表的常见操作</p>
<p>4、掌握列表的for迭代循环</p>
<p>5、掌握range的for迭代循环</p>
<p>-————————————————</p>
<p>1、列表的初始化</p>
<p>​    a=[]</p>
<p>​    b=[1,2,3]</p>
<p>​    #列表中可以存放5种基本数据类型</p>
<p>​    c=[1,”hello”,True,[1,2,3],None]   </p>
<p>​    books=[“math”,”english”,”chinese”]</p>
<p>2、列表的下标（座标）</p>
<p>​    使用len函数求列表长度，len(a)</p>
<p>​    列表是有序的，从0到n-1,n是列表的长度</p>
<p>3、访问和修改列表元素</p>
<p>​    books[i]</p>
<p>​    books[2]</p>
<p>​    books[2]=”it”</p>
<p>4、列表的常用方法</p>
<p>​    对象函数，对象.方法()</p>
<p>​    a.append(v)   向列表末尾插入元素       </p>
<p>5、for迭代循环（从一个【可循环对象】中依次取出元素）</p>
<p>books=[“math”,”english”,”chinese”]</p>
<p>for b in books:</p>
<p>​    print(b)</p>
<p>6、range(n)  简单理解：一个函数，生成一个可循环的对象，而且等差    </p>
<p>​    range(n)     0到(n-1)</p>
<p>​    range(m,n)   m-n    m可以取到，n取不到</p>
<p>​    range(m,n,d)   </p>
<p>7、练习</p>
<p>寻找水仙花数，</p>
<p>有个三位数abc，若abc=a<strong>3+b</strong>3+c**3</p>
<p>打印九九乘法表</p>
<p>print默认会输出换行符”\n”  ,print(end=”\n”)</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-python教学/4、第四课 if及for语句练习"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/17c288ad.html"
    >第四课 if及for语句练习</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/17c288ad.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>学习目标：</p>
<ol>
<li>强化列表的使用</li>
<li>巩固for循环的使用</li>
<li>巩固if语句的使用</li>
</ol>
<p>1、复习水仙花数</p>
<p>2、列表求和</p>
<p>3、闰年问题</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-python教学/5、第五课 列表求最值及冒泡排序"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/d900487e.html"
    >第五课 列表最值及冒泡排序</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/d900487e.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/python%E5%9F%BA%E7%A1%80/">python基础</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h2 id="学习目标："><a href="#学习目标：" class="headerlink" title="学习目标："></a><strong>学习目标：</strong></h2><ol>
<li>列表求和</li>
<li>列表求最值</li>
<li>列表排序</li>
</ol>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#使用的数据列表</span></span><br><span class="line">data=[<span class="number">5</span>,<span class="number">3</span>,<span class="number">2</span>,<span class="number">7</span>,<span class="number">6</span>,<span class="number">1</span>,<span class="number">9</span>,<span class="number">4</span>]</span><br></pre></td></tr></table></figure>





<p>1、列表通过循环求和</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sum</span>=<span class="number">0</span></span><br><span class="line"><span class="keyword">for</span> d <span class="keyword">in</span> data:</span><br><span class="line">    <span class="built_in">sum</span>=<span class="built_in">sum</span>+d</span><br><span class="line"><span class="comment">#for i in range(len(data)):</span></span><br><span class="line"><span class="comment">#    sum=sum+data[i]</span></span><br><span class="line"><span class="built_in">print</span>(<span class="built_in">sum</span>)</span><br></pre></td></tr></table></figure>





<p>2、求列表的最大值  </p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">max</span>=data[<span class="number">0</span>]</span><br><span class="line"><span class="keyword">for</span> d <span class="keyword">in</span> data:</span><br><span class="line">    <span class="keyword">if</span> d&gt;<span class="built_in">max</span>:</span><br><span class="line">        <span class="built_in">max</span>=d</span><br><span class="line"><span class="built_in">print</span>(<span class="built_in">max</span>)</span><br></pre></td></tr></table></figure>







<p>3、缩进的技巧：</p>
<p>​    Tab制表符   向右边缩进  ，选多行缩进</p>
<p>​    Shift+Tab        向左边删除缩进</p>
<p>注销行    多行    ctrl+/</p>
<p>4、列表冒泡排序</p>
<p>​    1、交换两个变量的值 a,b=b,a   list[i],list[j]=list[j],list[i]</p>
<p>​    2、把列表中的最大值置换到位置0</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data)):</span><br><span class="line">    <span class="keyword">if</span> data[i]&gt;data[<span class="number">0</span>]:</span><br><span class="line">        data[i],data[<span class="number">0</span>]=data[<span class="number">0</span>],data[i]</span><br></pre></td></tr></table></figure>





<p>3、使用多次循环找到第一大，第二大。。。。。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data)):</span><br><span class="line">    <span class="keyword">if</span> data[i]&gt;data[<span class="number">0</span>]:</span><br><span class="line">        data[i],data[<span class="number">0</span>]=data[<span class="number">0</span>],data[i]</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">1</span>，<span class="built_in">len</span>(data)):</span><br><span class="line">    <span class="keyword">if</span> data[i]&gt;data[<span class="number">1</span>]:</span><br><span class="line">        data[i],data[<span class="number">1</span>]=data[<span class="number">1</span>],data[i]</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">2</span>，<span class="built_in">len</span>(data)):</span><br><span class="line">    <span class="keyword">if</span> data[i]&gt;data[<span class="number">2</span>]:</span><br><span class="line">        data[i],data[<span class="number">2</span>]=data[<span class="number">2</span>],data[i]</span><br><span class="line">        </span><br><span class="line"><span class="comment">######........</span></span><br></pre></td></tr></table></figure>





<p>5、观察上诉代码，使用双层循环完成</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(data)-<span class="number">1</span>):</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(j,<span class="built_in">len</span>(data)):</span><br><span class="line">        <span class="keyword">if</span> data[i]&gt;data[j]:</span><br><span class="line">            data[i],data[j]=data[j],data[i]</span><br></pre></td></tr></table></figure>





<p>6、总结冒泡排序</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/" rel="tag">python</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-随笔/为何开始写blog"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/why_write_blog.html"
    >为何开始写blog</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/why_write_blog.html" class="article-date">
  <time datetime="2021-03-05T13:04:49.000Z" itemprop="datePublished">2021-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p>我为什么现在开始写blog？这是一个非常弱智的问题，但是对于一个文笔非常low的工科生来说，却无比的绞尽脑汁。因为回答这个问题，把“我为什么现在开始写blog”这句话分解，会得到如下几个关键字，“我”、“blog”、“现在”、“写”….，就意味着要回答很多很多个问题。那好吧，我就老老实实回答吧</p>
<h3 id="一、为何是我"><a href="#一、为何是我" class="headerlink" title="一、为何是我"></a>一、为何是我</h3><p>子曰：吾，十有五，而志于学，三十而立，四十而不惑，五十而知天命，六十而耳顺，七十而从心所欲，不逾矩。圣人之所以是圣人，就是他们能把他们死后几百上千年的人们的心里揣摩透！我的每个年龄段，都有着不一样的含义。就像我二十岁一样，是绝对瞧不上写博客这个毫无技术含量的事情的。可是为什么到了现在，我却发现写博客是一件非常重要的事情？我想把它当作生活中的一部分，记录生活中的点点滴滴，记录自己的喜怒哀乐，记录社会的兴旺发达，记录孩子的成长，记录学生的进步等等。我觉得年龄是个好东西，人的年龄和树的年轮一样，必须到了一定阶段，才能使得树壮士。当我跨过三十岁的年龄，每一次入眠，我都会觉得生命又少了一天，不回再有二十几岁那种挥霍时间毫不心疼的感觉。或许我真的老了，不过也该老了，孩子都这么大了，不该老了嘛！我只希望三十几岁的我，“愿我出走半生，归来仍是少年“，给孩子做好榜样，简简单单普普通通认真做事的榜样！</p>
<h3 id="二、为何是blog"><a href="#二、为何是blog" class="headerlink" title="二、为何是blog"></a>二、为何是blog</h3><p>既然要做博客，现在都流行做vlog短视频，为何还选择键盘文字呢？我倒不是说排斥视频，一是我是觉得文字可以让我现在的心暂时的安静下来，不再那么浮躁。二是视频很费精力，我现在还不想把精力浪费在这上面。简单的图片文字，能表达思想就行！</p>
<h3 id="三、为何是写"><a href="#三、为何是写" class="headerlink" title="三、为何是写"></a>三、为何是写</h3><h3 id="四、为何是现在"><a href="#四、为何是现在" class="headerlink" title="四、为何是现在"></a>四、为何是现在</h3><p>这个问题还有另一个反问，就是以前写过吗？当然写过，笔记本都好几个，网络博客账户也好几个。但是大多都没有成体系，成规模。往往是研究一个问题的时候心血来潮写几篇，过了可能几年也不会拿出来看。</p>
<h3 id="五、可以写点啥"><a href="#五、可以写点啥" class="headerlink" title="五、可以写点啥"></a>五、可以写点啥</h3><p>写了这么多乱七八糟的，现在最重要的来了。我能写点啥有用的东西出来？</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/blog/" rel="tag">blog</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9A%8F%E7%AC%94/" rel="tag">随笔</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
    <article
  id="post-小工具/Snipaste截图工具"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/Snipaste.html"
    >Snipaste截图工具</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/Snipaste.html" class="article-date">
  <time datetime="2020-03-05T13:04:49.000Z" itemprop="datePublished">2020-03-05</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E5%B0%8F%E5%B7%A5%E5%85%B7/">小工具</a>
  </div>
   
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <p> 顾名思义，Snipaste（sni+paste）是一款效率极高、功能非常丰富的<strong>截图+贴图</strong>小工具，可以有效提升我们的工作效率。 </p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%B0%8F%E5%B7%A5%E5%85%B7/" rel="tag">小工具</a></li></ul>

    </footer>
  </div>

   
    
</article>

    
  </article>
  

  
  <nav class="page-nav">
    
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/">下一页</a>
  </nav>
  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2020-2021
        <i class="ri-heart-fill heart_icon"></i> 东海
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        由 <a href="https://hexo.io" target="_blank">Hexo</a> 强力驱动
        <span class="division">|</span>
        主题 - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      
        <li>
          <a href="http://www.beian.miit.gov.cn/" target="_black" rel="nofollow">渝ICP备88888888</a>
        </li>
        
    </ul>
    <ul>
      
      <li>
          <img src="/images/beian.png"></img>
          <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=01234567890123" target="_black" rel="nofollow">渝公网安备01234567890123号</a>
      </li>
        
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="韩东海教学博客"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">存档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="http://schoolkit.lofter.com">相册</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/about">关于</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->
 <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script> 
<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->

<!-- ClickLove -->

<!-- ClickBoom1 -->

<script src="https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js"></script>

<script src="/js/clickBoom1.js"></script>
 
<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    <div id="music">
    
    
    
    <iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
        src="//music.163.com/outchain/player?type=2&id=22707008&auto=1&height=32"></iframe>
</div>

<style>
    #music {
        position: fixed;
        right: 15px;
        bottom: 0;
        z-index: 998;
    }
</style>
    
  </div>
</body>

</html>